﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting;
using System.Text;

namespace SimpleIpc
{
    public interface IRemoteChannel
    {
        string Name { get; }
        void RegisterWellKnownService<T>(string uri) where T : new();

        void RegisterWellKnownService<T>(string uri, WellKnownObjectMode mode) where T : new();

        /// <summary>
        /// 注册服务
        /// </summary>
        /// <param name="type">服务类型</param>
        /// <param name="uri">服务地址</param>
        /// <param name="mode"></param>
        void RegisterWellKnownService(Type type, string uri, WellKnownObjectMode mode);

        /// <summary>
        /// 获取远程对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uri">服务地址</param>
        /// <returns></returns>
        T GetObject<T>(string uri);

        void RegisterChannel();
        void UnregisterChannel();
    }
}
